package com.ruoyi.commissionconfig.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.commissionconfig.mapper.UserLevelCommissionConfigMapper;
import com.ruoyi.commissionconfig.domain.UserLevelCommissionConfig;
import com.ruoyi.commissionconfig.service.IUserLevelCommissionConfigService;

/**
 * 返佣配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-20
 */
@Service
public class UserLevelCommissionConfigServiceImpl implements IUserLevelCommissionConfigService 
{
    @Autowired
    private UserLevelCommissionConfigMapper userLevelCommissionConfigMapper;

    /**
     * 查询返佣配置
     * 
     * @param id 返佣配置主键
     * @return 返佣配置
     */
    @Override
    public UserLevelCommissionConfig selectUserLevelCommissionConfigById(Long id)
    {
        return userLevelCommissionConfigMapper.selectUserLevelCommissionConfigById(id);
    }

    /**
     * 查询返佣配置列表
     * 
     * @param userLevelCommissionConfig 返佣配置
     * @return 返佣配置
     */
    @Override
    public List<UserLevelCommissionConfig> selectUserLevelCommissionConfigList(UserLevelCommissionConfig userLevelCommissionConfig)
    {
        return userLevelCommissionConfigMapper.selectUserLevelCommissionConfigList(userLevelCommissionConfig);
    }

    /**
     * 新增返佣配置
     * 
     * @param userLevelCommissionConfig 返佣配置
     * @return 结果
     */
    @Override
    public int insertUserLevelCommissionConfig(UserLevelCommissionConfig userLevelCommissionConfig)
    {
        userLevelCommissionConfig.setCreateTime(DateUtils.getNowDate());
        return userLevelCommissionConfigMapper.insertUserLevelCommissionConfig(userLevelCommissionConfig);
    }

    /**
     * 修改返佣配置
     * 
     * @param userLevelCommissionConfig 返佣配置
     * @return 结果
     */
    @Override
    public int updateUserLevelCommissionConfig(UserLevelCommissionConfig userLevelCommissionConfig)
    {
        userLevelCommissionConfig.setUpdateTime(DateUtils.getNowDate());
        return userLevelCommissionConfigMapper.updateUserLevelCommissionConfig(userLevelCommissionConfig);
    }

    /**
     * 批量删除返佣配置
     * 
     * @param ids 需要删除的返佣配置主键
     * @return 结果
     */
    @Override
    public int deleteUserLevelCommissionConfigByIds(Long[] ids)
    {
        return userLevelCommissionConfigMapper.deleteUserLevelCommissionConfigByIds(ids);
    }

    /**
     * 删除返佣配置信息
     * 
     * @param id 返佣配置主键
     * @return 结果
     */
    @Override
    public int deleteUserLevelCommissionConfigById(Long id)
    {
        return userLevelCommissionConfigMapper.deleteUserLevelCommissionConfigById(id);
    }
}
